 
 <#-- 
 
 creates a function to get all the elements in a table..
 util for filling a combobox with a table...
 
 
 Author : Luis Molina...
 
 -->
<#-- variables used internally by the generator... -->
<#assign nameFile="aspx">
<#assign extensionFile="cs">
<#assign languageGenerated="c#">
<#assign description="c#">
<#assign targetDirectory="clases">
<#assign appliesToAllTables="true">
<#-- END variables used internally by the generator... -->

  
// devuelve una lista de ${table}
 
 		public static List< ${table} > getList()
		{
		    List< ${table} > lista${table} = new List< ${table} >();
            MySqlDataReader reg;
            string sqlt;
            dbClass db = new dbClass(ctes.conStringAdoGeneral);
            try
            {
            sqlt = "select ${table.getListWithAllFields()} from ${table}";
            reg = db.sql(sqlt);
            while (reg.Read())
                {
                ${table} pp = new ${table}();   
				<#list table.getFields() as field>
					 <#-- segun el tipo de campo...   -->
					 <#switch field.getType()>
						  <#case "_int">
							 pp.${field} = sf.Entero(reg["${field}"].ToString());
							 <#break>
						  <#case "_string">
							 pp.${field} = sf.Cadena(reg["${field}"].ToString());
							 <#break>
						  <#case "_date">
							 pp.${field} = sf.fecha(reg["${field}"].ToString());
							 <#break>
						  <#case "_boolean">
							 pp.${field} = sf.Bool(reg["${field}"].ToString());
							 <#break>
						  <#default>
							 pp.${field} = sf.Cadena(reg["${field}"].ToString());
					</#switch>  
				</#list>
               lista${table}.Add(pp);
			}
            reg.Close();
            }
            catch (Exception ex)
            {
                 
            }
            finally
            {
                db.Dispose();              
            }
            return lista${table};
       }		

 
 